package com.example.administrator.familfinalcialmanagement.ui.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;

import com.example.administrator.familfinalcialmanagement.R;
import com.example.administrator.familfinalcialmanagement.bean.PayInfoBean;
import com.example.administrator.familfinalcialmanagement.databinding.ActivityTodayPayDescBinding;
import com.example.administrator.familfinalcialmanagement.ui.BaseActivity;
import com.example.administrator.familfinalcialmanagement.util.ToastUtil;

/**
 * Created by SensYang on 2019/04/02 1:58
 */

public class TodayPayDescActivity extends BaseActivity {

    PayInfoBean bean;
    ActivityTodayPayDescBinding binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = DataBindingUtil.setContentView(this,R.layout.activity_today_pay_desc);
        binding.setActivity(this);
        initView();
    }

    private void initView() {
        setBack();
        setTitleText("消费明细");

        try {
            bean  = new PayInfoBean();
            String title = getIntent().getStringExtra("module_title");
            String info = getIntent().getStringExtra("module_info");
            String status = getIntent().getStringExtra("module_status");
            String style = getIntent().getStringExtra("module_style");
            String money = getIntent().getStringExtra("module_money");
            String time = getIntent().getStringExtra("module_time");

            if ("收入".equals(status)) {
                binding.tvModuleMan.setBackground(getResources().getDrawable(R.drawable.draw_activity_myinfo_sex_man));
                binding.tvModuleWoman.setBackground(getResources().getDrawable(R.drawable.draw_activity_myinfo_sex_woman));
            }else{
                binding.tvModuleMan.setBackground(getResources().getDrawable(R.drawable.draw_activity_myinfo_sex_man_noselect));
                binding.tvModuleWoman.setBackground(getResources().getDrawable(R.drawable.draw_activity_myinfo_sex_woman_select));
            }

            bean.setTitle(title);
            bean.setInfo(info);
            bean.setPayStatus(status);
            bean.setPayStyle(style);
            bean.setMoney(money);
            bean.setPayTime(time);
            binding.setBean(bean);
        }catch (Exception e){
            ToastUtil.showToast("传输失败");
        }

    }
}
